OBJCOPY = objcopy
endif
ifneq ($(COMPILE_ARCH),$(TARGET_ARCH))
-CC = /usr/local/sp_env/v2.2/i686/bin/ia64-unknown-linux-gcc
-LD = /usr/local/sp_env/v2.2/i686/bin/ia64-unknown-linux-ld
+CC = /usr/local/sp_env/v2.2.3/i686/bin/ia64-unknown-linux-gcc
+LD = /usr/local/sp_env/v2.2.3/i686/bin/ia64-unknown-linux-ld
OBJCOPY = /usr/local/sp_env/v2.2/i686/bin/ia64-unknown-linux-objcopy
endif
HOSTCC := gcc
// it should be unmangled
//This appears to work in Xen... turn it on later so no complications yet
-//#define CONFIG_MANGLE_RIDS
+#define CONFIG_MANGLE_RIDS
#ifdef CONFIG_MANGLE_RIDS
static inline unsigned long
vmMangleRID(unsigned long RIDVal)
// FIXME: validate ifa here (not in Xen space), COULD MACHINE CHECK!
// FIXME, must be inlined or potential for nested fault here!
+ if ((vcpu->domain==dom0) && (logps < PAGE_SHIFT)) {
+ printf("vcpu_itc_no_srlz: domain0 use of smaller page size!\n");
+ //FIXME: kill domain here
+ while(1);
+ }
psr = ia64_clear_ic();
ia64_itc(IorD,vaddr,pte,ps); // FIXME: look for bigger mappings
ia64_set_psr(psr);
// ia64_srlz_i(); // no srls req'd, will rfi later
+#ifdef VHPT_GLOBAL
+ if (vcpu->domain==dom0 && ((vaddr >> 61) == 7)) {
+ // FIXME: this is dangerous... vhpt_flush_address ensures these
+ // addresses never get flushed. More work needed if this
+ // ever happens.
+//printf("vhpt_insert(%p,%p,%p)\n",vaddr,pte,1L<<logps);
+ vhpt_insert(vaddr,pte,logps<<2);
+ }
+ // even if domain pagesize is larger than PAGE_SIZE, just put
+ // PAGE_SIZE mapping in the vhpt for now, else purging is complicated
+ else vhpt_insert(vaddr,pte,PAGE_SHIFT<<2);
+#endif
if (IorD & 0x4) return; // don't place in 1-entry TLB
if (IorD & 0x1) {
vcpu_set_tr_entry(&PSCB(vcpu,itlb),pte,ps<<2,vaddr);
// base = stride1 = stride2 = 0, count0 = count 1 = 1
// FIXME: When VHPT is in place, flush that too!
+#ifdef VHPT_GLOBAL
+ vhpt_flush(); // FIXME: This is overdoing it
+#endif
local_flush_tlb_all();
// just invalidate the "whole" tlb
vcpu_purge_tr_entry(&PSCB(vcpu,dtlb));
// FIXME: validate not flushing Xen addresses
// if (Xen address) return(IA64_ILLOP_FAULT);
// FIXME: ??breaks if domain PAGE_SIZE < Xen PAGE_SIZE
+#ifdef VHPT_GLOBAL
+ vhpt_flush_address(vadr,addr_range);
+#endif
ia64_global_tlb_purge(vadr,vadr+addr_range,PAGE_SHIFT);
vcpu_purge_tr_entry(&PSCB(vcpu,dtlb));
vcpu_purge_tr_entry(&PSCB(vcpu,itlb));
void vhpt_flush(void)
{
struct vhpt_lf_entry *v = (void *)VHPT_ADDR;
- int i;
+ int i, cnt = 0;
for (i = 0; i < VHPT_NUM_ENTRIES; i++, v++) {
v->itir = 0;
// initialize cache too???
}
+#ifdef VHPT_GLOBAL
+void vhpt_flush_address(unsigned long vadr, unsigned long addr_range)
+{
+ unsigned long ps;
+ struct vhpt_lf_entry *vlfe;
+
+ if ((vadr >> 61) == 7) {
+ // no vhpt for region 7 yet, see vcpu_itc_no_srlz
+ printf("vhpt_flush_address: region 7, spinning...\n");
+ while(1);
+ }
+#if 0
+ // this only seems to occur at shutdown, but it does occur
+ if ((!addr_range) || addr_range & (addr_range - 1)) {
+ printf("vhpt_flush_address: weird range, spinning...\n");
+ while(1);
+ }
+//printf("************** vhpt_flush_address(%p,%p)\n",vadr,addr_range);
+#endif
+ while ((long)addr_range > 0) {
+ vlfe = (struct vhpt_lf_entry *)ia64_thash(vadr);
+ // FIXME: for now, just blow it away even if it belongs to
+ // another domain. Later, use ttag to check for match
+//if (!(vlfe->ti_tag & INVALID_TI_TAG)) {
+//printf("vhpt_flush_address: blowing away valid tag for vadr=%p\n",vadr);
+//}
+ vlfe->ti_tag |= INVALID_TI_TAG;
+ addr_range -= PAGE_SIZE;
+ vadr += PAGE_SIZE;
+ }
+}
+#endif
+
void vhpt_map(void)
{
unsigned long psr;
stacked:
br.ret.sptk.few rp
END(pal_emulator_static)
+
+GLOBAL_ENTRY(vhpt_insert)
+// alloc loc0 = ar.pfs, 3, 1, 0, 0
+ mov r16=r32
+ mov r26=r33
+ mov r27=r34
+ ;;
+ VHPT_INSERT()
+// VHPT_INSERT1() ... add collision chains later
+// mov ar.pfs = loc0
+ br.ret.sptk.few rp
+ ;;
+END(vhpt_insert)
/* The stash space for the initial kernel image can now be freed up. */
init_domheap_pages(ia64_boot_param->initrd_start,
ia64_boot_param->initrd_start + ia64_boot_param->initrd_size);
- scrub_heap_pages();
+ if (!running_on_sim) // slow on ski and pages are pre-initialized to zero
+ scrub_heap_pages();
printk("About to call init_trace_bufs()\n");
init_trace_bufs();
#undef CLONE_DOMAIN0
//#define CLONE_DOMAIN0 5
#define DOMU_BUILD_STAGING
+#define VHPT_GLOBAL
// manufactured from component pieces
//#define VHPT_NUM_ENTRIES 131072
//#define VHPT_CACHE_MASK 131071
//#define VHPT_SIZE_LOG2 22 //????
+#define VHPT_CACHE_ENTRY_SIZE 64
#define VHPT_CACHE_NUM_ENTRIES 8192
#define VHPT_NUM_ENTRIES 524288
#define VHPT_CACHE_MASK 524287
and r23 = r23, r24;\
\
\
- movl r17 = G_VHPT_Cache;\
+ movl r17 = VHPT_ADDR;\
;;\
\
\